package com.xmfh.wemedia.controller;


import com.xmfh.wemedia.model.DdAlbum;
import com.xmfh.wemedia.service.IDdAlbumService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 相册表 前端控制器
 * </p>
 *
 * @author admin
 * @since 2022-04-03
 */
@Slf4j
@RestController
@RequestMapping("/wemedia/ddAlbum")
public class DdAlbumController {

    @Autowired(required = false)
    IDdAlbumService iDdAlbumService;

    @PostMapping("/addAlbum")
    public String addAlbum(@RequestBody DdAlbum album) {
        log.info("新增相册:"+album.toString());
        boolean f = iDdAlbumService.addAlbum(album);

        return "";
    }

    /**
     * 获取个人主页中相册分页信息
     *
     * @param session 网页缓存
     * @return 个人相册集合
     */
//    @GetMapping("/home_page/getPersonalAlbum")
//    public JsonResult<List<DdAlbum>> getPersonalAlbum(HttpSession session) {
//        return JsonResult.ok(
//                iDdAlbumService.getPersonalAlbumById(
//                        DdUserController.getCurrentUser(session).getId()));
//    }
}
